home *** CD-ROM | disk | FTP | other *** search
/ Zoom 2 / Zoom - Release 2 (1996)(Active Software)[!].iso / utilities / blankers / blitzblank_260 / developer / modulesources / bb.test.c < prev    next >
C/C++ Source or Header  |  1995-02-26  |  3KB  |  118 lines

  1.  
  2. /* Beispiel für eine GUI, ohne Blank-Funktion und ohne Lokalisierung! */
  3.  
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include <string.h>
  7. #include <dos/dos.h>
  8. #include <exec/memory.h>
  9. #include <intuition/intuitionbase.h>
  10. #include <intuition/screens.h>
  11. #include <intuition/intuition.h>
  12. #include <proto/exec.h>
  13. #include <proto/intuition.h>
  14. #include <proto/graphics.h>
  15. #include <pragmas/blitzblank_pragmas.h>
  16. #include <BlitzBlank.h>
  17.  
  18.  
  19. struct Library *BlitzBlankBase;
  20.  
  21. char *pgrouplabels[]={"PGroup Page 1","PGroup Page 2",NULL};
  22. char *cycleentries[]={"Option 1","Option 2","Option 3",NULL};
  23. char fontname[101]="Lall";
  24. char filename[101]="sys:";
  25.  
  26. char *infotext="\33c\33uTest\33n\n\nModul für BlitzBlank\n\nCopyright\n1994\nby Nobody";
  27.  
  28.  
  29. struct BB_Object object[]={ {&object[1] ,BB_PGroup,0,0,0,NULL,(char *)pgrouplabels},
  30.                             {&object[2] ,BB_VGroup,0,0,0,NULL,"VGroup1"},
  31.                             {&object[3] ,BB_Slider,0,99,10,NULL,"S_lider:"},
  32.                             {&object[4] ,BB_Font,0,100,0,fontname,"_Font:"},
  33.                             {&object[5] ,BB_VGroup_End,0,0,0,NULL,NULL},
  34.                             {&object[6] ,BB_VGroup,0,0,0,NULL,NULL},
  35.                             {&object[7] ,BB_File,0,100,0,filename,"_File:"},
  36.                             {&object[8] ,BB_Cycle,0,0,1,(char *)cycleentries,"C_ycle:"},
  37.                             {&object[9] ,BB_VGroup_End,0,0,0,NULL,NULL},
  38.                             {&object[10],BB_PGroup_End,0,0,0,NULL,NULL},
  39.                             {&object[11],BB_VGroup,0,0,0,NULL,"VGroup3"},
  40.                             {&object[12],BB_Check,0,0,1,NULL,"Check_1:"},
  41.                             {&object[13],BB_Check,0,0,0,NULL,"Check_2:"},
  42.                             {&object[14],BB_Check,0,0,1,NULL,"Check_3:"},
  43.                             {NULL       ,BB_VGroup_End,0,0,0,NULL,NULL} };
  44.  
  45.  
  46. /* You would use this for no GUI-objects at all */
  47. /* struct BB_Object object[]={ {NULL,BB_Dummy,0,0,0,NULL,NULL}}; */
  48.  
  49.  
  50. struct BB_Message message;
  51. struct BB_Screeninfo *screeninfo;
  52.  
  53.  
  54. void blank (void)
  55. {
  56.   printf ("xpos:%i\n",screeninfo->xpos);
  57.   printf ("ypos:%i\n",screeninfo->ypos);
  58.   printf ("width:%i\n",screeninfo->width);
  59.   printf ("height:%i\n",screeninfo->height);
  60.   printf ("depth:%i\n",screeninfo->depth);
  61.   printf ("mode:%x\n",screeninfo->mode);
  62.   printf ("bbscreen:%x\n",screeninfo->bbscreen);
  63.  
  64.   printf ("PGroup:%i\n",object[0].set);
  65.   printf ("Slider:%i\n",object[2].set);
  66.   printf ("Font:%s\n",fontname);
  67.   printf ("File:%s\n",filename);
  68.   printf ("Cycle:%i\n",object[7].set);
  69.   printf ("Check:%i\n",object[11].set);
  70.   printf ("Check:%i\n",object[12].set);
  71.   printf ("Check:%i\n",object[13].set);
  72.  
  73.   if (!CheckSignal (SIGBREAKF_CTRL_C))
  74.   {
  75.     BBL_ModuleRunning ();
  76.  
  77.     /* Blankaction */
  78.  
  79.     Wait (SIGBREAKF_CTRL_C);
  80.  
  81.   }
  82.   return;
  83. }
  84.  
  85.  
  86. void main (int argc,char **argv)
  87. {
  88.  
  89.   if (!(BlitzBlankBase=OpenLibrary ("blitzblank.library",BLITZBLANKLIB_VER)))
  90.     exit (0);
  91.  
  92.   message.flags=BBF_NoScreen;
  93.   message.infotext=infotext;
  94.   message.first=&object[0];
  95.  
  96.   if (strcmp (argv[1],"BLANK")==0)
  97.   {
  98.     StrToLong (argv[3],(long *) &screeninfo);
  99.     BBL_SendMessage (&message,argv[2]);
  100.     // if (screeninfo->bbscreen)
  101.       blank ();
  102.     BBL_BlankDone ();
  103.   }
  104.   else
  105.     if (strcmp (argv[1],"CONFIG")==0)
  106.     {
  107.       BBL_SendMessage (&message,argv[2]);
  108.     }
  109.     else
  110.     {
  111.       message.first=NULL;
  112.       BBL_SendMessage (&message,argv[2]);
  113.     }
  114.   CloseLibrary (BlitzBlankBase);
  115.   exit (0);
  116. }
  117.  
  118.